package com.itheima.mapper;


import com.itheima.pojo.ClazzQueryParam;
import com.itheima.pojo.Clazz;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface ClazzMapper {
    //分页查询
    List<Clazz> list(ClazzQueryParam param);

    //添加班级
    @Insert("insert into class values (null ,#{name},#{room},#{beginDate},#{endDate},#{masterId},#{subject},#{updateTime},#{createTime})")
    void insert(Clazz clazz);





    @Select("select c.*, e.name masterName from class c left join emp e on c.master_id = e.id where c.id = #{id};")
    Clazz getById(Integer id);
//    @Select("select * from class where  id = #{id}")
//    Clazz getInfo(Integer id);

    void update(Clazz clazz);
    @Delete("delete from class where id=#{id}")
    void deleteById(Integer id);
}
